;
(function($) {
    $.fn.aceona_slideImg= function(options) {
        options=$.extend({
            slideNum:1,
            timer:3000,
            verticalNum:2,
            stepNum:1
        },options|| {});
        return this.each(function(){
            var $_ULContent=$(this).find("ul").eq(0);
            var $_allLi=$_ULContent.find("li");
            var _hasNum=$_allLi.size();
            var _liWidth=$_allLi.eq(0).outerWidth(true);
            var _stepWidth=_liWidth*options.stepNum;
            var _allScollWidth=$(this)[0].scrollWidth;
            var _tempInterval;
            if(_hasNum%options.verticalNum==0){
                var _allWidth=_liWidth*_hasNum;
            }else{
                var _needAddElementNum=options.verticalNum-(_hasNum%options.verticalNum);
                var _allWidth=_liWidth*(_hasNum+_needAddElementNum);
                $_ULContent.find("li:lt("+_needAddElementNum+")").clone().appendTo($_ULContent);
            }
            var $_that=$(this);
            //根据２列，来决定容器的宽度
            var _contentWidth=_allWidth/options.verticalNum;
            $_ULContent.css("width",_contentWidth);
            var $_cloneUL=$_ULContent.clone();
            $_cloneUL.appendTo($(this).find(".js_inbox"));
            //判断是2个图片一列，由verticalNum设定
            //run
            function run(){
                  var currPos=$_that.scrollLeft();
                  var runPos=currPos+_stepWidth;
                   if(runPos>_contentWidth){
                       runPos=0;
                   }
                   $_that.animate({scrollLeft:runPos},{duration:"fast"});
            }
            function autoPlay(){
               _tempInterval=window.setInterval(function(){
                   run();
               },options.timer) 
            }
            function stop(){
                window.clearInterval(_tempInterval);
            }
            $(this).mouseover(function(){
                stop();
            }).mouseout(function(){
                autoPlay();
            })
            
            //init run
            autoPlay();
        })
    }
})(jQuery);